# Blokir akses ke file .php di folder public selain index.php
<Files "*.php">
    Order Deny,Allow
    Deny from all
</Files>
<Files "index.php">
    Order Allow,Deny
    Allow from all
</Files>

# Jika tidak ada folder/file yang cocok, kirim ke index.php
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ index.php [L]
</IfModule>